package com.gaohe.dcp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.dcp.mapper.DcpResultMapper;
import com.gaohe.dcp.domain.DcpResult;
import com.gaohe.dcp.service.IDcpResultService;

/**
 * 评测结果Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-23
 */
@Service
public class DcpResultServiceImpl implements IDcpResultService 
{
    @Autowired
    private DcpResultMapper dcpResultMapper;

    /**
     * 查询评测结果
     * 
     * @param resultId 评测结果主键
     * @return 评测结果
     */
    @Override
    public DcpResult selectDcpResultByResultId(Long resultId)
    {
        return dcpResultMapper.selectDcpResultByResultId(resultId);
    }

    /**
     * 查询评测结果列表
     * 
     * @param dcpResult 评测结果
     * @return 评测结果
     */
    @Override
    public List<DcpResult> selectDcpResultList(DcpResult dcpResult)
    {
        return dcpResultMapper.selectDcpResultList(dcpResult);
    }

    /**
     * 新增评测结果
     * 
     * @param dcpResult 评测结果
     * @return 结果
     */
    @Override
    public int insertDcpResult(DcpResult dcpResult)
    {
        dcpResult.setCreateTime(DateUtils.getNowDate());
        return dcpResultMapper.insertDcpResult(dcpResult);
    }

    /**
     * 修改评测结果
     * 
     * @param dcpResult 评测结果
     * @return 结果
     */
    @Override
    public int updateDcpResult(DcpResult dcpResult)
    {
        dcpResult.setUpdateTime(DateUtils.getNowDate());
        return dcpResultMapper.updateDcpResult(dcpResult);
    }

    /**
     * 批量删除评测结果
     * 
     * @param resultIds 需要删除的评测结果主键
     * @return 结果
     */
    @Override
    public int deleteDcpResultByResultIds(Long[] resultIds)
    {
        return dcpResultMapper.deleteDcpResultByResultIds(resultIds);
    }

    /**
     * 删除评测结果信息
     * 
     * @param resultId 评测结果主键
     * @return 结果
     */
    @Override
    public int deleteDcpResultByResultId(Long resultId)
    {
        return dcpResultMapper.deleteDcpResultByResultId(resultId);
    }
}
